//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS MediaPackageV2 service.
///
///  This guide is intended for creating AWS Elemental MediaPackage resources in MediaPackage Version 2 (v2) starting from May 2023. To get started with MediaPackage v2, create your MediaPackage resources. There isn't an automated process to migrate your resources from MediaPackage v1 to MediaPackage v2.  The names of the entities that you use to access this API, like URLs and ARNs, all have the versioning information added, like "v2", to distinguish from the prior version. If you used MediaPackage prior to this release, you can't use the MediaPackage v2 CLI or the MediaPackage v2 API to access any MediaPackage v1 resources. If you created resources in MediaPackage v1, use video on demand (VOD) workflows, and aren't looking to migrate to MediaPackage v2 yet, see the MediaPackage v1 Live API Reference.  This is the AWS Elemental MediaPackage v2 Live REST API Reference. It describes all the MediaPackage API operations for live content in detail, and provides sample requests, responses, and errors for the supported web services protocols. We assume that you have the IAM permissions that you need to use MediaPackage via the REST API. We also assume that you are familiar with the features and operations of MediaPackage, as described in the AWS Elemental MediaPackage User Guide.
public struct MediaPackageV2: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the MediaPackageV2 client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "MediaPackageV2",
            serviceIdentifier: "mediapackagev2",
            serviceProtocol: .restjson,
            apiVersion: "2022-12-25",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: MediaPackageV2ErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "ca-central-1": "mediapackagev2-fips.ca-central-1.amazonaws.com",
            "us-east-1": "mediapackagev2-fips.us-east-1.amazonaws.com",
            "us-east-2": "mediapackagev2-fips.us-east-2.amazonaws.com",
            "us-west-1": "mediapackagev2-fips.us-west-1.amazonaws.com",
            "us-west-2": "mediapackagev2-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Cancels an in-progress harvest job.
    @Sendable
    @inlinable
    public func cancelHarvestJob(_ input: CancelHarvestJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelHarvestJobResponse {
        try await self.client.execute(
            operation: "CancelHarvestJob", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/harvestJob/{HarvestJobName}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels an in-progress harvest job.
    ///
    /// Parameters:
    ///   - channelGroupName: The name of the channel group containing the channel from which the harvest job is running.
    ///   - channelName: The name of the channel from which the harvest job is running.
    ///   - eTag: The current Entity Tag (ETag) associated with the harvest job. Used for concurrency control.
    ///   - harvestJobName: The name of the harvest job to cancel. This name must be unique within the channel and cannot be changed after the harvest job is submitted.
    ///   - originEndpointName: The name of the origin endpoint that the harvest job is harvesting from. This cannot be changed after the harvest job is submitted.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelHarvestJob(
        channelGroupName: String,
        channelName: String,
        eTag: String? = nil,
        harvestJobName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelHarvestJobResponse {
        let input = CancelHarvestJobRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            eTag: eTag, 
            harvestJobName: harvestJobName, 
            originEndpointName: originEndpointName
        )
        return try await self.cancelHarvestJob(input, logger: logger)
    }

    /// Create a channel to start receiving content streams. The channel represents the input to MediaPackage for incoming live content from an encoder such as AWS Elemental MediaLive. The channel receives content, and after packaging it, outputs it through an origin endpoint to downstream devices (such as video players or CDNs) that request the content. You can create only one channel with each request. We recommend that you spread out channels between channel groups, such as putting redundant channels in the same AWS Region in different channel groups.
    @Sendable
    @inlinable
    public func createChannel(_ input: CreateChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateChannelResponse {
        try await self.client.execute(
            operation: "CreateChannel", 
            path: "/channelGroup/{ChannelGroupName}/channel", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a channel to start receiving content streams. The channel represents the input to MediaPackage for incoming live content from an encoder such as AWS Elemental MediaLive. The channel receives content, and after packaging it, outputs it through an origin endpoint to downstream devices (such as video players or CDNs) that request the content. You can create only one channel with each request. We recommend that you spread out channels between channel groups, such as putting redundant channels in the same AWS Region in different channel groups.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group. You can't change the name after you create the channel.
    ///   - clientToken: A unique, case-sensitive token that you provide to ensure the idempotency of the request.
    ///   - description: Enter any descriptive text that helps you to identify the channel.
    ///   - inputSwitchConfiguration: The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when InputType is CMAF.
    ///   - inputType: The input type will be an immutable field which will be used to define whether the channel will allow CMAF ingest or HLS ingest. If unprovided, it will default to HLS to preserve current behavior. The allowed values are:    HLS - The HLS streaming specification (which defines M3U8 manifests and TS segments).    CMAF - The DASH-IF CMAF Ingest specification (which defines CMAF segments with optional DASH manifests).
    ///   - outputHeaderConfiguration: The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when InputType is CMAF.
    ///   - tags: A comma-separated list of tag key:value pairs that you define. For example:  "Key1": "Value1",   "Key2": "Value2"
    ///   - logger: Logger use during operation
    @inlinable
    public func createChannel(
        channelGroupName: String,
        channelName: String,
        clientToken: String? = CreateChannelRequest.idempotencyToken(),
        description: String? = nil,
        inputSwitchConfiguration: InputSwitchConfiguration? = nil,
        inputType: InputType? = nil,
        outputHeaderConfiguration: OutputHeaderConfiguration? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateChannelResponse {
        let input = CreateChannelRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            clientToken: clientToken, 
            description: description, 
            inputSwitchConfiguration: inputSwitchConfiguration, 
            inputType: inputType, 
            outputHeaderConfiguration: outputHeaderConfiguration, 
            tags: tags
        )
        return try await self.createChannel(input, logger: logger)
    }

    /// Create a channel group to group your channels and origin endpoints. A channel group is the top-level resource that consists of channels and origin endpoints that are associated with it and that provides predictable URLs for stream delivery. All channels and origin endpoints within the channel group are guaranteed to share the DNS. You can create only one channel group with each request.
    @Sendable
    @inlinable
    public func createChannelGroup(_ input: CreateChannelGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateChannelGroupResponse {
        try await self.client.execute(
            operation: "CreateChannelGroup", 
            path: "/channelGroup", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Create a channel group to group your channels and origin endpoints. A channel group is the top-level resource that consists of channels and origin endpoints that are associated with it and that provides predictable URLs for stream delivery. All channels and origin endpoints within the channel group are guaranteed to share the DNS. You can create only one channel group with each request.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region. You can't use spaces in the name. You can't change the name after you create the channel group.
    ///   - clientToken: A unique, case-sensitive token that you provide to ensure the idempotency of the request.
    ///   - description: Enter any descriptive text that helps you to identify the channel group.
    ///   - tags: A comma-separated list of tag key:value pairs that you define. For example:  "Key1": "Value1",   "Key2": "Value2"
    ///   - logger: Logger use during operation
    @inlinable
    public func createChannelGroup(
        channelGroupName: String,
        clientToken: String? = CreateChannelGroupRequest.idempotencyToken(),
        description: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateChannelGroupResponse {
        let input = CreateChannelGroupRequest(
            channelGroupName: channelGroupName, 
            clientToken: clientToken, 
            description: description, 
            tags: tags
        )
        return try await self.createChannelGroup(input, logger: logger)
    }

    /// Creates a new harvest job to export content from a MediaPackage v2 channel to an S3 bucket.
    @Sendable
    @inlinable
    public func createHarvestJob(_ input: CreateHarvestJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateHarvestJobResponse {
        try await self.client.execute(
            operation: "CreateHarvestJob", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/harvestJob", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new harvest job to export content from a MediaPackage v2 channel to an S3 bucket.
    ///
    /// Parameters:
    ///   - channelGroupName: The name of the channel group containing the channel from which to harvest content.
    ///   - channelName: The name of the channel from which to harvest content.
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    ///   - description: An optional description for the harvest job.
    ///   - destination: The S3 destination where the harvested content will be placed.
    ///   - harvestedManifests: A list of manifests to be harvested.
    ///   - harvestJobName: A name for the harvest job. This name must be unique within the channel.
    ///   - originEndpointName: The name of the origin endpoint from which to harvest content.
    ///   - scheduleConfiguration: The configuration for when the harvest job should run, including start and end times.
    ///   - tags: A collection of tags associated with the harvest job.
    ///   - logger: Logger use during operation
    @inlinable
    public func createHarvestJob(
        channelGroupName: String,
        channelName: String,
        clientToken: String? = CreateHarvestJobRequest.idempotencyToken(),
        description: String? = nil,
        destination: Destination,
        harvestedManifests: HarvestedManifests,
        harvestJobName: String? = nil,
        originEndpointName: String,
        scheduleConfiguration: HarvesterScheduleConfiguration,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateHarvestJobResponse {
        let input = CreateHarvestJobRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            clientToken: clientToken, 
            description: description, 
            destination: destination, 
            harvestedManifests: harvestedManifests, 
            harvestJobName: harvestJobName, 
            originEndpointName: originEndpointName, 
            scheduleConfiguration: scheduleConfiguration, 
            tags: tags
        )
        return try await self.createHarvestJob(input, logger: logger)
    }

    /// The endpoint is attached to a channel, and represents the output of the live content. You can associate multiple endpoints to a single channel. Each endpoint gives players and downstream CDNs (such as Amazon CloudFront) access to the content for playback. Content can't be served from a channel until it has an endpoint. You can create only one endpoint with each request.
    @Sendable
    @inlinable
    public func createOriginEndpoint(_ input: CreateOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateOriginEndpointResponse {
        try await self.client.execute(
            operation: "CreateOriginEndpoint", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// The endpoint is attached to a channel, and represents the output of the live content. You can associate multiple endpoints to a single channel. Each endpoint gives players and downstream CDNs (such as Amazon CloudFront) access to the content for playback. Content can't be served from a channel until it has an endpoint. You can create only one endpoint with each request.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - clientToken: A unique, case-sensitive token that you provide to ensure the idempotency of the request.
    ///   - containerType: The type of container to attach to this origin endpoint. A container type is a file format that encapsulates one or more media streams, such as audio and video, into a single file. You can't change the container type after you create the endpoint.
    ///   - dashManifests: A DASH manifest configuration.
    ///   - description: Enter any descriptive text that helps you to identify the origin endpoint.
    ///   - forceEndpointErrorConfiguration: The failover settings for the endpoint.
    ///   - hlsManifests: An HTTP live streaming (HLS) manifest configuration.
    ///   - lowLatencyHlsManifests: A low-latency HLS manifest configuration.
    ///   - mssManifests: A list of Microsoft Smooth Streaming (MSS) manifest configurations for the origin endpoint. You can configure multiple MSS manifests to provide different streaming experiences or to support different client requirements.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and must be unique for your account in the AWS Region and channel. You can't use spaces in the name. You can't change the name after you create the endpoint.
    ///   - segment: The segment configuration, including the segment name, duration, and other configuration values.
    ///   - startoverWindowSeconds: The size of the window (in seconds) to create a window of the live stream that's available for on-demand viewing. Viewers can start-over or catch-up on content that falls within the window. The maximum startover window is 1,209,600 seconds (14 days).
    ///   - tags: A comma-separated list of tag key:value pairs that you define. For example:  "Key1": "Value1",   "Key2": "Value2"
    ///   - logger: Logger use during operation
    @inlinable
    public func createOriginEndpoint(
        channelGroupName: String,
        channelName: String,
        clientToken: String? = CreateOriginEndpointRequest.idempotencyToken(),
        containerType: ContainerType,
        dashManifests: [CreateDashManifestConfiguration]? = nil,
        description: String? = nil,
        forceEndpointErrorConfiguration: ForceEndpointErrorConfiguration? = nil,
        hlsManifests: [CreateHlsManifestConfiguration]? = nil,
        lowLatencyHlsManifests: [CreateLowLatencyHlsManifestConfiguration]? = nil,
        mssManifests: [CreateMssManifestConfiguration]? = nil,
        originEndpointName: String,
        segment: Segment? = nil,
        startoverWindowSeconds: Int? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateOriginEndpointResponse {
        let input = CreateOriginEndpointRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            clientToken: clientToken, 
            containerType: containerType, 
            dashManifests: dashManifests, 
            description: description, 
            forceEndpointErrorConfiguration: forceEndpointErrorConfiguration, 
            hlsManifests: hlsManifests, 
            lowLatencyHlsManifests: lowLatencyHlsManifests, 
            mssManifests: mssManifests, 
            originEndpointName: originEndpointName, 
            segment: segment, 
            startoverWindowSeconds: startoverWindowSeconds, 
            tags: tags
        )
        return try await self.createOriginEndpoint(input, logger: logger)
    }

    /// Delete a channel to stop AWS Elemental MediaPackage from receiving further content. You must delete the channel's origin endpoints before you can delete the channel.
    @Sendable
    @inlinable
    public func deleteChannel(_ input: DeleteChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteChannelResponse {
        try await self.client.execute(
            operation: "DeleteChannel", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a channel to stop AWS Elemental MediaPackage from receiving further content. You must delete the channel's origin endpoints before you can delete the channel.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteChannel(
        channelGroupName: String,
        channelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteChannelResponse {
        let input = DeleteChannelRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName
        )
        return try await self.deleteChannel(input, logger: logger)
    }

    /// Delete a channel group. You must delete the channel group's channels and origin endpoints before you can delete the channel group. If you delete a channel group, you'll lose access to the egress domain and will have to create a new channel group to replace it.
    @Sendable
    @inlinable
    public func deleteChannelGroup(_ input: DeleteChannelGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteChannelGroupResponse {
        try await self.client.execute(
            operation: "DeleteChannelGroup", 
            path: "/channelGroup/{ChannelGroupName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a channel group. You must delete the channel group's channels and origin endpoints before you can delete the channel group. If you delete a channel group, you'll lose access to the egress domain and will have to create a new channel group to replace it.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteChannelGroup(
        channelGroupName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteChannelGroupResponse {
        let input = DeleteChannelGroupRequest(
            channelGroupName: channelGroupName
        )
        return try await self.deleteChannelGroup(input, logger: logger)
    }

    /// Delete a channel policy.
    @Sendable
    @inlinable
    public func deleteChannelPolicy(_ input: DeleteChannelPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteChannelPolicyResponse {
        try await self.client.execute(
            operation: "DeleteChannelPolicy", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a channel policy.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteChannelPolicy(
        channelGroupName: String,
        channelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteChannelPolicyResponse {
        let input = DeleteChannelPolicyRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName
        )
        return try await self.deleteChannelPolicy(input, logger: logger)
    }

    /// Origin endpoints can serve content until they're deleted. Delete the endpoint if it should no longer respond to playback requests. You must delete all endpoints from a channel before you can delete the channel.
    @Sendable
    @inlinable
    public func deleteOriginEndpoint(_ input: DeleteOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteOriginEndpointResponse {
        try await self.client.execute(
            operation: "DeleteOriginEndpoint", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Origin endpoints can serve content until they're deleted. Delete the endpoint if it should no longer respond to playback requests. You must delete all endpoints from a channel before you can delete the channel.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and and must be unique for your account in the AWS Region and channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteOriginEndpoint(
        channelGroupName: String,
        channelName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteOriginEndpointResponse {
        let input = DeleteOriginEndpointRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            originEndpointName: originEndpointName
        )
        return try await self.deleteOriginEndpoint(input, logger: logger)
    }

    /// Delete an origin endpoint policy.
    @Sendable
    @inlinable
    public func deleteOriginEndpointPolicy(_ input: DeleteOriginEndpointPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteOriginEndpointPolicyResponse {
        try await self.client.execute(
            operation: "DeleteOriginEndpointPolicy", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete an origin endpoint policy.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and and must be unique for your account in the AWS Region and channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteOriginEndpointPolicy(
        channelGroupName: String,
        channelName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteOriginEndpointPolicyResponse {
        let input = DeleteOriginEndpointPolicyRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            originEndpointName: originEndpointName
        )
        return try await self.deleteOriginEndpointPolicy(input, logger: logger)
    }

    /// Retrieves the specified channel that's configured in AWS Elemental MediaPackage.
    @Sendable
    @inlinable
    public func getChannel(_ input: GetChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetChannelResponse {
        try await self.client.execute(
            operation: "GetChannel", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the specified channel that's configured in AWS Elemental MediaPackage.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - logger: Logger use during operation
    @inlinable
    public func getChannel(
        channelGroupName: String,
        channelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetChannelResponse {
        let input = GetChannelRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName
        )
        return try await self.getChannel(input, logger: logger)
    }

    /// Retrieves the specified channel group that's configured in AWS Elemental MediaPackage.
    @Sendable
    @inlinable
    public func getChannelGroup(_ input: GetChannelGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetChannelGroupResponse {
        try await self.client.execute(
            operation: "GetChannelGroup", 
            path: "/channelGroup/{ChannelGroupName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the specified channel group that's configured in AWS Elemental MediaPackage.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - logger: Logger use during operation
    @inlinable
    public func getChannelGroup(
        channelGroupName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetChannelGroupResponse {
        let input = GetChannelGroupRequest(
            channelGroupName: channelGroupName
        )
        return try await self.getChannelGroup(input, logger: logger)
    }

    /// Retrieves the specified channel policy that's configured in AWS Elemental MediaPackage. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources.
    @Sendable
    @inlinable
    public func getChannelPolicy(_ input: GetChannelPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetChannelPolicyResponse {
        try await self.client.execute(
            operation: "GetChannelPolicy", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the specified channel policy that's configured in AWS Elemental MediaPackage. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - logger: Logger use during operation
    @inlinable
    public func getChannelPolicy(
        channelGroupName: String,
        channelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetChannelPolicyResponse {
        let input = GetChannelPolicyRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName
        )
        return try await self.getChannelPolicy(input, logger: logger)
    }

    /// Retrieves the details of a specific harvest job.
    @Sendable
    @inlinable
    public func getHarvestJob(_ input: GetHarvestJobRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetHarvestJobResponse {
        try await self.client.execute(
            operation: "GetHarvestJob", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/harvestJob/{HarvestJobName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the details of a specific harvest job.
    ///
    /// Parameters:
    ///   - channelGroupName: The name of the channel group containing the channel associated with the harvest job.
    ///   - channelName: The name of the channel associated with the harvest job.
    ///   - harvestJobName: The name of the harvest job to retrieve.
    ///   - originEndpointName: The name of the origin endpoint associated with the harvest job.
    ///   - logger: Logger use during operation
    @inlinable
    public func getHarvestJob(
        channelGroupName: String,
        channelName: String,
        harvestJobName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetHarvestJobResponse {
        let input = GetHarvestJobRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            harvestJobName: harvestJobName, 
            originEndpointName: originEndpointName
        )
        return try await self.getHarvestJob(input, logger: logger)
    }

    /// Retrieves the specified origin endpoint that's configured in AWS Elemental MediaPackage to obtain its playback URL and to view the packaging settings that it's currently using.
    @Sendable
    @inlinable
    public func getOriginEndpoint(_ input: GetOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetOriginEndpointResponse {
        try await self.client.execute(
            operation: "GetOriginEndpoint", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the specified origin endpoint that's configured in AWS Elemental MediaPackage to obtain its playback URL and to view the packaging settings that it's currently using.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and and must be unique for your account in the AWS Region and channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func getOriginEndpoint(
        channelGroupName: String,
        channelName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetOriginEndpointResponse {
        let input = GetOriginEndpointRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            originEndpointName: originEndpointName
        )
        return try await self.getOriginEndpoint(input, logger: logger)
    }

    /// Retrieves the specified origin endpoint policy that's configured in AWS Elemental MediaPackage.
    @Sendable
    @inlinable
    public func getOriginEndpointPolicy(_ input: GetOriginEndpointPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetOriginEndpointPolicyResponse {
        try await self.client.execute(
            operation: "GetOriginEndpointPolicy", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the specified origin endpoint policy that's configured in AWS Elemental MediaPackage.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and and must be unique for your account in the AWS Region and channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func getOriginEndpointPolicy(
        channelGroupName: String,
        channelName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetOriginEndpointPolicyResponse {
        let input = GetOriginEndpointPolicyRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            originEndpointName: originEndpointName
        )
        return try await self.getOriginEndpointPolicy(input, logger: logger)
    }

    /// Retrieves all channel groups that are configured in Elemental MediaPackage.
    @Sendable
    @inlinable
    public func listChannelGroups(_ input: ListChannelGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListChannelGroupsResponse {
        try await self.client.execute(
            operation: "ListChannelGroups", 
            path: "/channelGroup", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all channel groups that are configured in Elemental MediaPackage.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return in the response.
    ///   - nextToken: The pagination token from the GET list request. Use the token to fetch the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listChannelGroups(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListChannelGroupsResponse {
        let input = ListChannelGroupsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listChannelGroups(input, logger: logger)
    }

    /// Retrieves all channels in a specific channel group that are configured in AWS Elemental MediaPackage.
    @Sendable
    @inlinable
    public func listChannels(_ input: ListChannelsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListChannelsResponse {
        try await self.client.execute(
            operation: "ListChannels", 
            path: "/channelGroup/{ChannelGroupName}/channel", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all channels in a specific channel group that are configured in AWS Elemental MediaPackage.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - maxResults: The maximum number of results to return in the response.
    ///   - nextToken: The pagination token from the GET list request. Use the token to fetch the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listChannels(
        channelGroupName: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListChannelsResponse {
        let input = ListChannelsRequest(
            channelGroupName: channelGroupName, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listChannels(input, logger: logger)
    }

    /// Retrieves a list of harvest jobs that match the specified criteria.
    @Sendable
    @inlinable
    public func listHarvestJobs(_ input: ListHarvestJobsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListHarvestJobsResponse {
        try await self.client.execute(
            operation: "ListHarvestJobs", 
            path: "/channelGroup/{ChannelGroupName}/harvestJob", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a list of harvest jobs that match the specified criteria.
    ///
    /// Parameters:
    ///   - channelGroupName: The name of the channel group to filter the harvest jobs by. If specified, only harvest jobs associated with channels in this group will be returned.
    ///   - channelName: The name of the channel to filter the harvest jobs by. If specified, only harvest jobs associated with this channel will be returned.
    ///   - maxResults: The maximum number of harvest jobs to return in a single request. If not specified, a default value will be used.
    ///   - nextToken: A token used for pagination. Provide this value in subsequent requests to retrieve the next set of results.
    ///   - originEndpointName: The name of the origin endpoint to filter the harvest jobs by. If specified, only harvest jobs associated with this origin endpoint will be returned.
    ///   - status: The status to filter the harvest jobs by. If specified, only harvest jobs with this status will be returned.
    ///   - logger: Logger use during operation
    @inlinable
    public func listHarvestJobs(
        channelGroupName: String,
        channelName: String? = nil,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        originEndpointName: String? = nil,
        status: HarvestJobStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListHarvestJobsResponse {
        let input = ListHarvestJobsRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            originEndpointName: originEndpointName, 
            status: status
        )
        return try await self.listHarvestJobs(input, logger: logger)
    }

    /// Retrieves all origin endpoints in a specific channel that are configured in AWS Elemental MediaPackage.
    @Sendable
    @inlinable
    public func listOriginEndpoints(_ input: ListOriginEndpointsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListOriginEndpointsResponse {
        try await self.client.execute(
            operation: "ListOriginEndpoints", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves all origin endpoints in a specific channel that are configured in AWS Elemental MediaPackage.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - maxResults: The maximum number of results to return in the response.
    ///   - nextToken: The pagination token from the GET list request. Use the token to fetch the next page of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listOriginEndpoints(
        channelGroupName: String,
        channelName: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListOriginEndpointsResponse {
        let input = ListOriginEndpointsRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listOriginEndpoints(input, logger: logger)
    }

    /// Lists the tags assigned to a resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags assigned to a resource.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the CloudWatch resource that you want to view tags for.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Attaches an IAM policy to the specified channel. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources. You can attach only one policy with each request.
    @Sendable
    @inlinable
    public func putChannelPolicy(_ input: PutChannelPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutChannelPolicyResponse {
        try await self.client.execute(
            operation: "PutChannelPolicy", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Attaches an IAM policy to the specified channel. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources. You can attach only one policy with each request.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - policy: The policy to attach to the specified channel.
    ///   - logger: Logger use during operation
    @inlinable
    public func putChannelPolicy(
        channelGroupName: String,
        channelName: String,
        policy: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutChannelPolicyResponse {
        let input = PutChannelPolicyRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            policy: policy
        )
        return try await self.putChannelPolicy(input, logger: logger)
    }

    /// Attaches an IAM policy to the specified origin endpoint. You can attach only one policy with each request.
    @Sendable
    @inlinable
    public func putOriginEndpointPolicy(_ input: PutOriginEndpointPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutOriginEndpointPolicyResponse {
        try await self.client.execute(
            operation: "PutOriginEndpointPolicy", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Attaches an IAM policy to the specified origin endpoint. You can attach only one policy with each request.
    ///
    /// Parameters:
    ///   - cdnAuthConfiguration: The settings for using authorization headers between the MediaPackage endpoint and your CDN.  For information about CDN authorization, see CDN authorization in Elemental MediaPackage in the MediaPackage user guide.
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and and must be unique for your account in the AWS Region and channel.
    ///   - policy: The policy to attach to the specified origin endpoint.
    ///   - logger: Logger use during operation
    @inlinable
    public func putOriginEndpointPolicy(
        cdnAuthConfiguration: CdnAuthConfiguration? = nil,
        channelGroupName: String,
        channelName: String,
        originEndpointName: String,
        policy: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutOriginEndpointPolicyResponse {
        let input = PutOriginEndpointPolicyRequest(
            cdnAuthConfiguration: cdnAuthConfiguration, 
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            originEndpointName: originEndpointName, 
            policy: policy
        )
        return try await self.putOriginEndpointPolicy(input, logger: logger)
    }

    /// Resetting the channel can help to clear errors from misconfigurations in the encoder. A reset refreshes the ingest stream and removes previous content.   Be sure to stop the encoder before you reset the channel, and wait at least 30 seconds before you restart the encoder.
    @Sendable
    @inlinable
    public func resetChannelState(_ input: ResetChannelStateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ResetChannelStateResponse {
        try await self.client.execute(
            operation: "ResetChannelState", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/reset", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Resetting the channel can help to clear errors from misconfigurations in the encoder. A reset refreshes the ingest stream and removes previous content.   Be sure to stop the encoder before you reset the channel, and wait at least 30 seconds before you restart the encoder.
    ///
    /// Parameters:
    ///   - channelGroupName: The name of the channel group that contains the channel that you are resetting.
    ///   - channelName: The name of the channel that you are resetting.
    ///   - logger: Logger use during operation
    @inlinable
    public func resetChannelState(
        channelGroupName: String,
        channelName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ResetChannelStateResponse {
        let input = ResetChannelStateRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName
        )
        return try await self.resetChannelState(input, logger: logger)
    }

    /// Resetting the origin endpoint can help to resolve unexpected behavior and other content packaging issues. It also helps to preserve special events when you don't want the previous content to be available for viewing. A reset clears out all previous content from the origin endpoint. MediaPackage might return old content from this endpoint in the first 30 seconds after the endpoint reset. For best results, when possible, wait 30 seconds from endpoint reset to send playback requests to this endpoint.
    @Sendable
    @inlinable
    public func resetOriginEndpointState(_ input: ResetOriginEndpointStateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ResetOriginEndpointStateResponse {
        try await self.client.execute(
            operation: "ResetOriginEndpointState", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/reset", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Resetting the origin endpoint can help to resolve unexpected behavior and other content packaging issues. It also helps to preserve special events when you don't want the previous content to be available for viewing. A reset clears out all previous content from the origin endpoint. MediaPackage might return old content from this endpoint in the first 30 seconds after the endpoint reset. For best results, when possible, wait 30 seconds from endpoint reset to send playback requests to this endpoint.
    ///
    /// Parameters:
    ///   - channelGroupName: The name of the channel group that contains the channel with the origin endpoint that you are resetting.
    ///   - channelName: The name of the channel with the origin endpoint that you are resetting.
    ///   - originEndpointName: The name of the origin endpoint that you are resetting.
    ///   - logger: Logger use during operation
    @inlinable
    public func resetOriginEndpointState(
        channelGroupName: String,
        channelName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ResetOriginEndpointStateResponse {
        let input = ResetOriginEndpointStateRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            originEndpointName: originEndpointName
        )
        return try await self.resetOriginEndpointState(input, logger: logger)
    }

    /// Assigns one of more tags (key-value pairs) to the specified MediaPackage resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values. You can use the TagResource operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Assigns one of more tags (key-value pairs) to the specified MediaPackage resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values. You can use the TagResource operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the MediaPackage resource that you're adding tags to.
    ///   - tags: Contains a map of the key-value pairs for the resource tag or tags assigned to the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes one or more tags from the specified resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{ResourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes one or more tags from the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The ARN of the MediaPackage resource that you're removing tags from.
    ///   - tagKeys: The list of tag keys to remove from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Update the specified channel. You can edit if MediaPackage sends ingest or egress access logs to the CloudWatch log group, if content will be encrypted, the description on a channel, and your channel's policy settings. You can't edit the name of the channel or CloudFront distribution details. Any edits you make that impact the video output may not be reflected for a few minutes.
    @Sendable
    @inlinable
    public func updateChannel(_ input: UpdateChannelRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateChannelResponse {
        try await self.client.execute(
            operation: "UpdateChannel", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update the specified channel. You can edit if MediaPackage sends ingest or egress access logs to the CloudWatch log group, if content will be encrypted, the description on a channel, and your channel's policy settings. You can't edit the name of the channel or CloudFront distribution details. Any edits you make that impact the video output may not be reflected for a few minutes.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - description: Any descriptive information that you want to add to the channel for future identification purposes.
    ///   - eTag: The expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.
    ///   - inputSwitchConfiguration: The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when InputType is CMAF.
    ///   - outputHeaderConfiguration: The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when InputType is CMAF.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateChannel(
        channelGroupName: String,
        channelName: String,
        description: String? = nil,
        eTag: String? = nil,
        inputSwitchConfiguration: InputSwitchConfiguration? = nil,
        outputHeaderConfiguration: OutputHeaderConfiguration? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateChannelResponse {
        let input = UpdateChannelRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            description: description, 
            eTag: eTag, 
            inputSwitchConfiguration: inputSwitchConfiguration, 
            outputHeaderConfiguration: outputHeaderConfiguration
        )
        return try await self.updateChannel(input, logger: logger)
    }

    /// Update the specified channel group. You can edit the description on a channel group for easier identification later from the AWS Elemental MediaPackage console. You can't edit the name of the channel group. Any edits you make that impact the video output may not be reflected for a few minutes.
    @Sendable
    @inlinable
    public func updateChannelGroup(_ input: UpdateChannelGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateChannelGroupResponse {
        try await self.client.execute(
            operation: "UpdateChannelGroup", 
            path: "/channelGroup/{ChannelGroupName}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update the specified channel group. You can edit the description on a channel group for easier identification later from the AWS Elemental MediaPackage console. You can't edit the name of the channel group. Any edits you make that impact the video output may not be reflected for a few minutes.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - description: Any descriptive information that you want to add to the channel group for future identification purposes.
    ///   - eTag: The expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateChannelGroup(
        channelGroupName: String,
        description: String? = nil,
        eTag: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateChannelGroupResponse {
        let input = UpdateChannelGroupRequest(
            channelGroupName: channelGroupName, 
            description: description, 
            eTag: eTag
        )
        return try await self.updateChannelGroup(input, logger: logger)
    }

    /// Update the specified origin endpoint. Edit the packaging preferences on an endpoint to optimize the viewing experience. You can't edit the name of the endpoint. Any edits you make that impact the video output may not be reflected for a few minutes.
    @Sendable
    @inlinable
    public func updateOriginEndpoint(_ input: UpdateOriginEndpointRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateOriginEndpointResponse {
        try await self.client.execute(
            operation: "UpdateOriginEndpoint", 
            path: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Update the specified origin endpoint. Edit the packaging preferences on an endpoint to optimize the viewing experience. You can't edit the name of the endpoint. Any edits you make that impact the video output may not be reflected for a few minutes.
    ///
    /// Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - containerType: The type of container attached to this origin endpoint. A container type is a file format that encapsulates one or more media streams, such as audio and video, into a single file.
    ///   - dashManifests: A DASH manifest configuration.
    ///   - description: Any descriptive information that you want to add to the origin endpoint for future identification purposes.
    ///   - eTag: The expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.
    ///   - forceEndpointErrorConfiguration: The failover settings for the endpoint.
    ///   - hlsManifests: An HTTP live streaming (HLS) manifest configuration.
    ///   - lowLatencyHlsManifests: A low-latency HLS manifest configuration.
    ///   - mssManifests: A list of Microsoft Smooth Streaming (MSS) manifest configurations to update for the origin endpoint. This replaces the existing MSS manifest configurations.
    ///   - originEndpointName: The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and and must be unique for your account in the AWS Region and channel.
    ///   - segment: The segment configuration, including the segment name, duration, and other configuration values.
    ///   - startoverWindowSeconds: The size of the window (in seconds) to create a window of the live stream that's available for on-demand viewing. Viewers can start-over or catch-up on content that falls within the window. The maximum startover window is 1,209,600 seconds (14 days).
    ///   - logger: Logger use during operation
    @inlinable
    public func updateOriginEndpoint(
        channelGroupName: String,
        channelName: String,
        containerType: ContainerType,
        dashManifests: [CreateDashManifestConfiguration]? = nil,
        description: String? = nil,
        eTag: String? = nil,
        forceEndpointErrorConfiguration: ForceEndpointErrorConfiguration? = nil,
        hlsManifests: [CreateHlsManifestConfiguration]? = nil,
        lowLatencyHlsManifests: [CreateLowLatencyHlsManifestConfiguration]? = nil,
        mssManifests: [CreateMssManifestConfiguration]? = nil,
        originEndpointName: String,
        segment: Segment? = nil,
        startoverWindowSeconds: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateOriginEndpointResponse {
        let input = UpdateOriginEndpointRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            containerType: containerType, 
            dashManifests: dashManifests, 
            description: description, 
            eTag: eTag, 
            forceEndpointErrorConfiguration: forceEndpointErrorConfiguration, 
            hlsManifests: hlsManifests, 
            lowLatencyHlsManifests: lowLatencyHlsManifests, 
            mssManifests: mssManifests, 
            originEndpointName: originEndpointName, 
            segment: segment, 
            startoverWindowSeconds: startoverWindowSeconds
        )
        return try await self.updateOriginEndpoint(input, logger: logger)
    }
}

extension MediaPackageV2 {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: MediaPackageV2, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MediaPackageV2 {
    /// Return PaginatorSequence for operation ``listChannelGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelGroupsPaginator(
        _ input: ListChannelGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListChannelGroupsRequest, ListChannelGroupsResponse> {
        return .init(
            input: input,
            command: self.listChannelGroups,
            inputKey: \ListChannelGroupsRequest.nextToken,
            outputKey: \ListChannelGroupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listChannelGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return in the response.
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelGroupsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListChannelGroupsRequest, ListChannelGroupsResponse> {
        let input = ListChannelGroupsRequest(
            maxResults: maxResults
        )
        return self.listChannelGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listChannels(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelsPaginator(
        _ input: ListChannelsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListChannelsRequest, ListChannelsResponse> {
        return .init(
            input: input,
            command: self.listChannels,
            inputKey: \ListChannelsRequest.nextToken,
            outputKey: \ListChannelsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listChannels(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - maxResults: The maximum number of results to return in the response.
    ///   - logger: Logger used for logging
    @inlinable
    public func listChannelsPaginator(
        channelGroupName: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListChannelsRequest, ListChannelsResponse> {
        let input = ListChannelsRequest(
            channelGroupName: channelGroupName, 
            maxResults: maxResults
        )
        return self.listChannelsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listHarvestJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listHarvestJobsPaginator(
        _ input: ListHarvestJobsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListHarvestJobsRequest, ListHarvestJobsResponse> {
        return .init(
            input: input,
            command: self.listHarvestJobs,
            inputKey: \ListHarvestJobsRequest.nextToken,
            outputKey: \ListHarvestJobsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listHarvestJobs(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelGroupName: The name of the channel group to filter the harvest jobs by. If specified, only harvest jobs associated with channels in this group will be returned.
    ///   - channelName: The name of the channel to filter the harvest jobs by. If specified, only harvest jobs associated with this channel will be returned.
    ///   - maxResults: The maximum number of harvest jobs to return in a single request. If not specified, a default value will be used.
    ///   - originEndpointName: The name of the origin endpoint to filter the harvest jobs by. If specified, only harvest jobs associated with this origin endpoint will be returned.
    ///   - status: The status to filter the harvest jobs by. If specified, only harvest jobs with this status will be returned.
    ///   - logger: Logger used for logging
    @inlinable
    public func listHarvestJobsPaginator(
        channelGroupName: String,
        channelName: String? = nil,
        maxResults: Int? = nil,
        originEndpointName: String? = nil,
        status: HarvestJobStatus? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListHarvestJobsRequest, ListHarvestJobsResponse> {
        let input = ListHarvestJobsRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            maxResults: maxResults, 
            originEndpointName: originEndpointName, 
            status: status
        )
        return self.listHarvestJobsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listOriginEndpoints(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listOriginEndpointsPaginator(
        _ input: ListOriginEndpointsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListOriginEndpointsRequest, ListOriginEndpointsResponse> {
        return .init(
            input: input,
            command: self.listOriginEndpoints,
            inputKey: \ListOriginEndpointsRequest.nextToken,
            outputKey: \ListOriginEndpointsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listOriginEndpoints(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelGroupName: The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.
    ///   - channelName: The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group.
    ///   - maxResults: The maximum number of results to return in the response.
    ///   - logger: Logger used for logging
    @inlinable
    public func listOriginEndpointsPaginator(
        channelGroupName: String,
        channelName: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListOriginEndpointsRequest, ListOriginEndpointsResponse> {
        let input = ListOriginEndpointsRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            maxResults: maxResults
        )
        return self.listOriginEndpointsPaginator(input, logger: logger)
    }
}

extension MediaPackageV2.ListChannelGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackageV2.ListChannelGroupsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MediaPackageV2.ListChannelsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackageV2.ListChannelsRequest {
        return .init(
            channelGroupName: self.channelGroupName,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension MediaPackageV2.ListHarvestJobsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackageV2.ListHarvestJobsRequest {
        return .init(
            channelGroupName: self.channelGroupName,
            channelName: self.channelName,
            maxResults: self.maxResults,
            nextToken: token,
            originEndpointName: self.originEndpointName,
            status: self.status
        )
    }
}

extension MediaPackageV2.ListOriginEndpointsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> MediaPackageV2.ListOriginEndpointsRequest {
        return .init(
            channelGroupName: self.channelGroupName,
            channelName: self.channelName,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

// MARK: Waiters

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MediaPackageV2 {
    /// Waiter for operation ``getHarvestJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilHarvestJobFinished(
        _ input: GetHarvestJobRequest,
        maxWaitTime: TimeAmount? = nil,
        logger: Logger = AWSClient.loggingDisabled
    ) async throws {
        let waiter = AWSClient.Waiter<GetHarvestJobRequest, _>(
            acceptors: [
                .init(state: .success, matcher: try! JMESPathMatcher("status", expected: "COMPLETED")),
                .init(state: .success, matcher: try! JMESPathMatcher("status", expected: "CANCELLED")),
                .init(state: .failure, matcher: try! JMESPathMatcher("status", expected: "FAILED")),
                .init(state: .retry, matcher: try! JMESPathMatcher("status", expected: "QUEUED")),
                .init(state: .retry, matcher: try! JMESPathMatcher("status", expected: "IN_PROGRESS")),
            ],
            command: self.getHarvestJob
        )
        return try await self.client.waitUntil(input, waiter: waiter, maxWaitTime: maxWaitTime, logger: logger)
    }
    /// Waiter for operation ``getHarvestJob(_:logger:)``.
    ///
    /// - Parameters:
    ///   - channelGroupName: The name of the channel group containing the channel associated with the harvest job.
    ///   - channelName: The name of the channel associated with the harvest job.
    ///   - harvestJobName: The name of the harvest job to retrieve.
    ///   - originEndpointName: The name of the origin endpoint associated with the harvest job.
    ///   - logger: Logger used for logging
    @inlinable
    public func waitUntilHarvestJobFinished(
        channelGroupName: String,
        channelName: String,
        harvestJobName: String,
        originEndpointName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = GetHarvestJobRequest(
            channelGroupName: channelGroupName, 
            channelName: channelName, 
            harvestJobName: harvestJobName, 
            originEndpointName: originEndpointName
        )
        try await self.waitUntilHarvestJobFinished(input, logger: logger)
    }
}
